# PACs & January 6th
# Kenneth M. Miller & Tanner Bates

# Figure 1. predicted probabilities with rug plot
library(tidyverse)
library(margins)

jansix <- read_csv("PACs_and_J6.csv")

# run probit
pac_vote_pct <- glm(anyreject ~ biz_pct00 + housevote + trumpvote + dw_one + terms, 
                family = binomial(link = "probit"), data = jansix)
summary(pac_vote_pct)

pac_vote_mill <- glm(anyreject ~ biz_mill + housevote + trumpvote + dw_one + terms, 
                    family = binomial(link = "probit"), data = jansix)
summary(pac_vote_mill)

# generate plot
par(mfrow=c(1,2))
cplot(pac_vote_pct, "biz_pct00", what = "prediction", ylim=c(0,1), ylab="Pr(vote to object)", 
      xlab="Business PAC contribution percentage")
cplot(pac_vote_mill, "biz_mill", what = "prediction", ylim=c(0,1), ylab="Pr(vote to object)", 
      xlab="Business PAC contributions in millions")
# Export PDF 4.5 x 8







